package com.siashan.toolkit.captcha.easy;

import com.siashan.toolkit.captcha.core.CaptchaInfo;
import com.siashan.toolkit.captcha.core.ICaptcha;
import com.wf.captcha.base.Captcha;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * Easy图形验证码
 *
 * @author siashan
 * @since v1.0.3
 **/
@Setter
@Getter
@NoArgsConstructor
public class EasyCaptcha implements ICaptcha {

    /**
     * Google DefaultKaptcha 对象
     */
    private Captcha kaptcha;


    public EasyCaptcha(Captcha kaptcha) {
        this.kaptcha = kaptcha;
    }


    /**
     * 渲染
     */
    @Override
    public CaptchaInfo render() {
        return  EasyCaptchaUtil.render(kaptcha).getCaptchaInfo();
    }
}
